export interface IChangeValueOptions {
    row: number;
    col: number;
    sheet: GC.Spread.Sheets.Worksheet;
    sheetArea: GC.Spread.Sheets.SheetArea;
    newValue: string;
    oldValue: string;
}
export default {
    canUndo: true,
    execute: (context: GC.Spread.Sheets.Workbook, options: IChangeValueOptions, isUndo: boolean) => {
        const { row, col, sheet, sheetArea, newValue, oldValue } = options;
        const bool = !sheet.isPaintSuspended();
        if (bool) {
            sheet.suspendPaint();
        }

        if (isUndo) {
            sheet.setValue(row, col, oldValue, sheetArea);
        } else {
            sheet.setValue(row, col, newValue, sheetArea);
            (sheet as any).Du().trigger(GC.Spread.Sheets.Events.ValueChanged, {sheet, row, col, sheetArea, newValue, oldValue})
           // context.getActiveSheet().
          //  (context as any).trigger(GC.Spread.Sheets.Events.ValueChanged, {sheet, row, col, sheetArea, newValue, oldValue});
        }
        if(bool) {
            sheet.resumePaint();
        }
        
    }
};